#include<bits/stdc++.h>
using namespace std;
#define int long long

int f[1000005] {7, 11};

signed main() {
	for (int i = 2; i <= 1000000; i++)
		f[i] = (f[i - 1] + f[i - 2]) % 3;

	int n;
	while (cin >> n) {
		if (f[n] % 3)
			cout << "No" << endl;
		else
			cout << "Yes" << endl;
	}
	return 0;
}
